package com.atguigu.day21.file01;

import org.junit.Test;

import java.io.File;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/26 10:09
 * @注释
 */
public class FileExer {

    @Test
    public void test01(){
        File f = new File("D:\\Personal blog");
        showFile(f);
    }

    private void showFile(File f) {
        File[] files = f.listFiles();
        for (File file : files) {
            if (file.isFile()) {
                System.out.println("file = " + file);
            }else {
                System.out.println("--------------------"+ file.getName() +"--------------------");
                showFile(file);
            }


        }

    }
}
